import request from '@/utils/request'

// 账单管理API接口
export const billApi = {
  // 根据账单状态获取账单
  getBillByStatus(params) {
    return request({
      url: '/bill/getBillByStatus',
      method: 'post',
      data: params
    })
  },

  // 根据账单类型或搜索获取账单
  getBillByTypeOrSearch(params) {
    return request({
      url: '/bill/getBillByTypeOrSearch',
      method: 'post',
      data: params
    })
  },

  // 根据账单ID获取账单详情
  getBillById(billId) {
    return request({
      url: `/bill/getBillById/${billId}`,
      method: 'get'
    })
  },

  // 删除账单
  deleteBillById(billId) {
    return request({
      url: `/bill/deleteBillById/${billId}`,
      method: 'delete'
    })
  },

  // 获取合同列表
  getContractList(params) {
    return request({
      url: '/bill/getContractList',
      method: 'post',
      data: params
    })
  },

  // 退款申请
  refundBill(data) {
    return request({
      url: '/bill/refund',
      method: 'post',
      data
    })
  }
}
